package com.itheima.chapter09.file;

import java.io.File;
import java.io.IOException;

//Flie创建功能
public class FileDome2 {
    public static void main(String[] args) throws IOException {
        method1();
        method2();
        method3();


    }

    private static void method3() {
        File file =new File("D:\\my_project\\ab");
        boolean mkdirs = file.mkdirs();
        System.out.println(mkdirs);
        File file1 =new File("D:\\my_project\\abc\\abcd");
        boolean mkdirs1 = file1.mkdirs();
        System.out.println(mkdirs1);
        System.out.println("-----------------------");
    }

    private static void method2() {
        File file =new File("D:\\my_project\\aa");
        boolean mkdir = file.mkdir();
        System.out.println(mkdir);
        File file1 =new File("D:\\my_project\\bb\\cc");
        boolean mkdir1 = file1.mkdir();
        System.out.println(mkdir1);
        System.out.println("-----------------------");
    }

    private static void method1() throws IOException {
        File file1 =new File("D:\\my_project\\a.txt");
        File file2 =new File("D:\\my_project\\b.txt");
        boolean r1 = file1.createNewFile();
        boolean r2 = file2.createNewFile();
        System.out.println(r1);
        System.out.println(r2);
        System.out.println("-----------------------");
    }
}
